Watchdog timers are peripheral devices which are used to monitor the correct performance of a processor. They are often an integrated peripheral in a microcontroller. A watchdog timer once set is basically a timer that counts for a predetermined time. Once the predetermined time is expired the watchdog timer will generate a reset which sets the monitored device back into a known state. A program needs to reset the watchdog timer periodically to its start condition to ensure that no such reset occurs. Thus, only when the program malfunctions the watchdog timer will not be reset and therefore cause a system reset once its time limit has been reached.
Thus, watchdog timer are generally used in microcontroller devices and in computer systems to provide a control mechanism that prevents a system from acting erratic if for unknown reasons the microprocessor deviates from the programmed execution flow. According to a specific embodiment of a watchdog timer, a watchdog timer is set to count down from a predetermined number and the executed program includes reset instructions at specific points within the program that prevent an overrun of the watchdog by resetting it to the predetermined number. Once the watchdog timer overruns it will generate a reset or interrupt to allow the system to recover. During program execution when everything performs perfectly, the watchdog timer will never overrun. However, any malfunctioning for whatever reasons that lock up the microprocessor or microcontroller or deviate the execution of the programmed instructions will cause the watchdog timer to overrun and the system will be reset.